//
//  MoreViewController.m
//  第六组电影项目
//
//  Created by 6-1 on 14-7-3.
//  Copyright (c) 2014年 www.skedu.com.cn北京尚德智远科技有限公司. All rights reserved.
//

#import "MoreViewController.h"

@interface MoreViewController () <UITableViewDataSource,UITableViewDelegate>

@end

@implementation MoreViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        self.title=@"更多";
        
    }
    return self;
}
-(void)loadView
{
    [super loadView];
    _popView=[[UIImageView alloc]initWithFrame:CGRectMake(168, kDeviceHeight-300, 145, 182)];
    _popView.userInteractionEnabled=YES;
    _popView.image=[UIImage imageNamed:@"moreView_setting_new"];
    [self.view addSubview:_popView];
    
    _tableView=[[UITableView alloc]initWithFrame:CGRectMake(0, 0, _popView.width, _popView.height-9) style:UITableViewStylePlain];
    _tableView.layer.cornerRadius=5;
    _tableView.backgroundColor=[UIColor clearColor];
    _tableView.scrollEnabled=NO;
    _tableView.dataSource=self;
    _tableView.delegate=self;
    [_popView addSubview:_tableView];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 4;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    cell.backgroundColor=[UIColor clearColor];
    
    if (indexPath.row==0) {
        cell.imageView.image=[UIImage imageNamed:@"more_search"];
        cell.textLabel.text=@"搜索";
    }
    else if (indexPath.row==1){
        cell.imageView.image=[UIImage imageNamed:@"more_fav"];
        cell.textLabel.text=@"收藏";
    }
    else if (indexPath.row==2){
        cell.imageView.image=[UIImage imageNamed:@"more_set"];
        cell.textLabel.text=@"设置";
    }
    else {
        cell.imageView.image=[UIImage imageNamed:@"more_info"];
        cell.textLabel.text=@"关于";
    }
    
    UIView *bgView = [[UIView alloc]init];
    bgView.backgroundColor = [UIColor orangeColor];
    cell.selectedBackgroundView = bgView;
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    switch (indexPath.row)
    {
        case 0:
            self.title =@"搜索";
            break;
          
        case 1:
            self.title =@"收藏";
            break;
            
        case 2:
            self.title =@"设置";
            break;
            
        case 3:
            self.title =@"关于";
            break;
        default:
            break;
    }
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
